home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d18 / qwik40.arc / CURSOR.DOC next >
Text File  |  1991-01-09  |  5KB  |  108 lines

  1. { Cursor.doc - documentation for QWIK cursor routines       ver 4.0, 12-01-87 }
  2.  
  3.   GotoRC - Like Turbo's GotoXY, this procedure moves the cursor, but with a 
  4.   couple of important differences.  The cursor is absolute to the entire 
  5.   screen and ignores the limits set by the Turbo Window procedure.  In 
  6.   addition, it will work on all the other video pages besides page 0.
  7.  
  8.   CursorChange - This procedure will let you change the mode (shape and 
  9.   visibility) of the cursor.  At the same time, it saves the previous mode.  
  10.   Using hex is the easiest way to set the integer.  The shape of the cursor 
  11.   is defined by horizontal scan lines in the character cell where the top row 
  12.   is of any cell is 0.  The starting (upper) row of the cursor mode is the 
  13.   high (or left) byte of the integer and the ending (lower) row is the low 
  14.   (or right) byte.  In addition, bits 5 and 6 of the starting row byte 
  15.   control on/off and erratic blinking (remember a byte has bits 0 to 7).  See 
  16.   QINIT.DOC for cell sizes.
  17.  
  18.      Shape:       Adapter   Default  Comments
  19.                   --------  -------  -------------------------
  20.                   MDA       $0B0C
  21.                   CGA,MCGA  $0607
  22.                   EGA       $0B0C    MD, ECD (640x350 25-line)
  23.                   EGA       $0607    CD, ECD (640x200)
  24.                   VGA       $0D0E    Emulation off
  25. |                 3270 PC   $0D0D    And converts MDA and CGA
  26.  
  27.      Cursor off:  Set start row bits 6-5 = 01.  All other bits don't matter.
  28.      Blinking:    Set start row bits 6-5 = 11.  Creates erratic blinking on 
  29.                   most machines.
  30.  
  31.      Suggestions: For block cursor,  set New:=$000E (Works on all machines.)
  32.                   For hidden cursor, set New:=$2000
  33.  
  34.   CursorOff - Rather than using CursorChange to hide the cursor, use this 
  35.   procedure.  You don't have to save the current cursor shape since all it 
  36.   does is set the cursor-off bit on the current cursor mode.
  37.  
  38.   CursorOn - To restore the cursor after turning it off with CursorOff, use 
  39.   this procedure.  The previous shape is maintained.
  40.  
  41. | WhereR/WhereC - Also like Turbo's WhereX/WhereY, these functions detect 
  42. | cursor position, but with the same differences as GotoRC.
  43.  
  44.   Suggestions - Use discretion when changing the cursor mode.  Some users 
  45.   prefer a block cursor for all their applications.  If your program forces 
  46.   it to an underline, try to restore the original cursor.  Programs like 
  47.   WordStar, never even touch the cursor.  There is only one case that I know 
  48.   where you must set the cursor mode before using CursorOff/On.  The early 
  49.   PCs had a bug in the BIOS that set the MDA default to be CGA instead.  You 
  50.   can check for ActiveDispDev=MdaMono and a $0607 cursor.  If so, change it 
  51.   to $0B0C for an underline.
  52.  
  53.   EGA Cursor Emulation - With 640x200, the emulation works fairly well.  With 
  54.   640x350 and 25-line mode, the emulation works, too.  Outside of that, it is 
  55.   suggested that any needed changes should be made with emulation off which 
  56.   can be done be setting bit 0 of EgaInfo equal to 1.
  57.  
  58.   MCGA Cursor Emulation - Use the CGA cursor cell size even though the 
  59.   character cell is 8x16.  The BIOS multiplies the start and end rows by 2 
  60.   and then adds one to the end row before writing to the hardware video port 
  61.   to emulate the CGA.
  62.  
  63.   VGA Cursor Emulation - Qinit sets the cursor emulation mode on so you don't 
  64.   have to worry about special fonts and cells sizes.  The only cell sizes you 
  65.   need to know is the MDA and CGA.  The video BIOS will adjust your cursor 
  66.   shape to fit in the current cell size.  Here's the cursor shapes (types) 
  67.   recognized by the VGA algorithm and how it responds:
  68.  
  69.      Cursor Type   Condition            Action
  70.      ------------  -------------------  ---------------
  71.      Hidden (off)  start bits 6-5 = 01  pass
  72.      Split         start > end          invert to block
  73.      Overbar       start < end <= 3     pass
  74.      Underline     start+2 >= end       adjust
  75.      Full-block    start <= 2           adjust
  76.      Half-block    start > 2            adjust
  77.  
  78.  
  79.   For adjustment, three more tests are required:
  80.  
  81.      Condition                          Action
  82.      --------------------------------   ----------
  83.      start or end >= cell height        adjust
  84.      end = cell height - 1              pass
  85.      start = cell height - 2            pass
  86.  
  87.  
  88.   The final adjustment is made to the corresponding cursor type:
  89.  
  90.      Cursor Type  Adjustment
  91.      -----------  -------------------------------------------------
  92.      Overbar      pass
  93.      Underline    move start/end to bottom of cell
  94.      Half-block   start = cell height/2; move end to bottom of cell
  95.      Full-block   move end to bottom of cell
  96.  
  97.  
  98. | 3270 PC Peculiarites - The 3270 PC cursor types are limited to only three.  
  99. | In addition, the underline cursor is not visible on a white background on 
  100. | the 5272 color display and it is advisable to use a block cursor together 
  101. | with that attribute:
  102. |
  103. |    Cursor Type   Comments
  104. |    ------------  ---------------------------------------------------
  105. |    Underline     $0D0D only.  CGA and MDA are emulated to this type.
  106. |    Hidden (off)  cursor start > cursor end.  $2000 is preferred.
  107. |    Block         anything other than the above
  108.